readMap

open fun <K, V> readMap(@NonNull in: Parcel, @NonNull outVal: Map<in K, in V>, @Nullable loader: ClassLoader, @NonNull clazzKey: Class<K>, @NonNull clazzValue: Class<V>)(source)

Same as readMap but accepts clazzKey and clazzValue parameter as the types required for each key and value pair. Compatibility behavior:

  • SDK 34 and later, this method matches platform behavior.
  • SDK 33 and below, this method will not check the map entries' types.

Throws

If the item to be deserialized is not an instance of that class or any of its children class.